import os
import sys

# 请在此输入您的代码

p = {'yuanxing':1, 'zhengfangxing':2, 'changfangxing':3, 'sanjiaoxing':4, 'tuoyuanxing':5, 'liubianxing':6}

n = int(input())
a = input().split()
ans = 0
for i in a:
    ans += p[i]
print(ans)